feat: receive agentInput (remote agent control v1, Atem side)#11
Open
guohai wants to merge 1 commit into
Open
Conversation
…t PTY
Completes the Atem side of remote agent control v1. Astation (merged) sends
`agentInput` over the relay; Atem now receives it and drives the focused
agent's terminal.
- AstationMessage::AgentInput { agent_id, kind, text, key } matching the
Astation wire shape exactly ({type:"agentInput", data:{agentId?, kind,
text?, key?}}).
- handle_agent_input: kind:"text" trims/skips-empty then types the line +
submit sequence (\n\r, matching send_claude_prompt); kind:"key" writes raw
PTY bytes via agent_key_to_bytes (enter/esc/ctrl-c/up/down/left/right/y/n).
- Routes to the codex PTY when it's the focused chat, else claude; no-ops if
no agent session is live (v1: drives an already-running agent only).
- 10 tests: wire deserialization/roundtrip, key→bytes mapping, and handler
routing asserting exact bytes reach the PTY (incl. empty-text + unknown-key).
🤖 Built with SMT <smt@agora.build>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the Atem side of remote agent control v1. Astation (merged in
Agora-Build/AstationPR #6) now sendsagentInput; this PR makes Atem receive it and drive the focused coding agent's terminal — so you can type instructions or send control keys (interrupt, approve/reject a tool prompt) to a Claude Code / Codex session running under atem.Before this, Astation's remote-control UI emitted
agentInputand Atem silently dropped it (only the design existed). Now the round-trip is complete.What it does
AstationMessage::AgentInput { agent_id, kind, text, key }— matches the merged Astation wire shape exactly ({type:"agentInput", data:{agentId?, kind, text?, key?}}), grounded inAstation/Sources/Menubar/AstationMessage.swift.handle_agent_input:kind:"text"→ trim + skip-empty, then type the line and submit (\n\r, matching the app's existingsend_claude_prompt).kind:"key"→ write raw PTY bytes viaagent_key_to_bytes(enter/esc/ctrl-c/up/down/left/right/y/n).agent_idis ignored in v1 (focused/only agent = current chat mode).Tests
10 new tests, all green: wire deserialization + roundtrip, key→bytes mapping, and handler routing asserting the exact bytes reach the PTY (text submit sequence, raw control bytes, codex routing, empty-text drop, unknown-key drop).
cargo buildclean. agentInput suite fully passing. (The repo has a known pre-existing parallel-fs flake inagent_visualize::testsunrelated to this change — passes serially.)Reviewed
Passed a code-quality review against the actual Astation contract (key strings, CSI byte sequences verified against
tui/mod.rs) — approved, no Critical/Important issues. Applied the suggested empty-text guard and synced the design doc (designs/remote-agent-control.md) to the real\n\rsubmit sequence.Design:
designs/remote-agent-control.md.Generated with SMT smt@agora.build